package com.zua.util;
import java.io.FileWriter;
import java.io.IOException;
/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */
public class AlipayConfig {
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2016110300790120";
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQCxSIrFsShUB64JgBw8o08MnROxDghi+wqMbSU7tnpIpP5jEGo8VsMl/GwNjyWyJ36fbCEOrM4+dsgHc5X7O1JQ0Joj532EpTWFQ6RI24fpiuOioGvcpada4t0LkNw4csVGxmeMO3csuMrgEkrVZsPRGR9yN/tsFlDU2JpKE62bQGvUwrwfytdoREUxUdy7+J4yNg0aKtai8V6tuTZ4jt51vS/pCEgxoOO6QKDkPa9Ei8oEqr8MERJYBHulj4J4bfNb3kVRyP/cgiE5cuoKlBOoAsUom5bvT+Ep7egPUJEl2AuCL7/FxLViDwDwZcJh8yBr5bh6N5e8sXe/4ddDeAjVAgMBAAECggEBAKjMKVWSGJPpvAvPrxMNa3bXGKi8c7/Kx4Bta8YvOL9yWcR5HK3W7nh8n2VJptq6QBYLHm6amsVe05ZEt8k98mKAPENzZk+l/g+lGAdG/2GenJ97nze3gmFHILCifQxCOxPoVS9wb0hlqsUupZILBudQxGA8bWe817nRgxaFJgdq9p0nXZUdlHlWEVU5i26VA4jLgtMfi5/AHcciRXoZOU8I3O3IFF8wKewOn1wFKFpCLqIewQaOJzrS/HUOsqFN5mtxOpJhBNYnVxzkPJHgLBUf9NZfDtT59tvxEtZHTNm1+kPmAnhb+yIuOHi2CH1zvkRFrTXvo5n56JPnDzLQyAECgYEA8FjZQj/I0Bh6oThyRPOK6yBXAGXSVAsxrpR5lhi0Q0VwvUjWefmPcFEmQ4OPEogevyb6v/kQV40Zy81cw4wr6iMRJzSa25UgtxZMfA3rh/6VGngrtszunlTZuxl73dRrnbKIcgqqypGFFIFPRQUedvpUjYOJIz4eAGQo0y/X4g0CgYEAvNRF65RoyHb/bCGGtlaa6t+o6eubE0S6+MyUYgfE3XPEyMkAsn0ammq1fkkp/9s76A7+nxXUKyIcnB6FBzGSnIwzGV9+6o0KlS4yZzNqlrvCK+kRuZYida4ONRHRZ9OkzFv+L6yJCH3sidALuDpzRKbZ9Sfs1y3ZCQZTQnX0t+kCgYEAnLSxYtqHqfZr7jYJex93kfpR/3Zj/lwWFofEBrMwxTO/YArfnEO03DxswFREsoaB1YwqrYRMvWjISvMo6m64Kz6V7oQD++ttmzI0yCWjTdYVjV6Q0e0oH5+fHrhs5KOdTwKaqBCAbvcWV9o/vvapeFWbT3FVtt7HXOXxIFDvZvkCgYEAjE2RMkyQWrsIaBi1FpBdBT1wLXbxP6zm2+xuKDSrkvvs8F9hVD3eYXP+LLpCKaiE55UUnbHDdtUeuuV2ZHTyAb2uTiEFlVN81IGB0+qBPUR/Ls87a1Dhg9zzE32MwX+hSHLl+BhTrWqbMX7S5m0Prqfm9OBYez3GsIzxmkU4stkCgYBjfK8SbdePOtLACj21uS98tKFFrdJXZY5SWOTVj9jasRkwSqqd1GsRcvnnxBXp/U1kS/+5u21MMNY5aNywF4F+lq7ySgB2ahfcPU/6W2POiPRNqIloEZdECzBergBe1dnFuTaEqWvYMmYF3SxARmnNFNZOCNU/XGPqsuBf+prU0w==";
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjTP/rOUJnnWgHBgdIto6v9o1u3WUhJLycp4qRSaoIc2v7fqhK5ZhrPCPDMoIUaC/VBW38OI+AebQZN5wuxq1M2tPy9PW0pu2lA0/jVTtkpXPBsai3cEw6in9a9h7psWG0DCV2fJjzwFrR9Yv6UodSdSRQ9DJM9osyxZkfWc1cujyq5bOd5FsSIV+i82rkcqmnF1XoJt8NUsQYhd3HgmvbretHMIJpTWupPmpzwoVgQBGo2OGVIXwb4X2PxhyAqNfjATDgOnUxbId2iTEftJNvJvN90f+241xlOddg97SNaPpzuxRRuKnBCOnPq1aMBj/uPu+Sdc22svp2gyM+g7iNwIDAQAB";
	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://192.168.15.126:8989/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";
	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
//	public static String return_url = "http://192.168.15.126:8989/alipay.trade.page.pay-JAVA-UTF-8/return_url.jsp";
	public static String return_url = "http://localhost:8989/ZuaMarket/User/user/payOrder";
	// 签名方式
	public static String sign_type = "RSA2";
	// 字符编码格式
	public static String charset = "utf-8";
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	// 支付宝网关
	public static String log_path = "C:\\";
//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
